<!--
 * @Author: wrngygy
 * @Date: 2025-07-01
 * @Description: 应用主入口组件
-->

<template>
	<div id="app">
		<router-view />
    <LoginPrompt/>
	</div>
</template>

<script setup lang="ts">
import { onMounted } from 'vue';
import LoginPrompt from '@/components/LoginPrompt.vue'

// 注入wx对象
var isWeapp = window.__wxjs_environment === "miniprogram";

if (isWeapp) {
  var script = document.createElement('script');
  script.src = 'https://res.wx.qq.com/open/js/jweixin-1.3.2.js';
  script.type = "text/javascript";
  
  document.body.appendChild(script);
}

// 设置rem比例
function setRem() {
	const baseSize = 16 // rem:px = 1:16
	const baseWidth = 1920 // 设计稿宽度
	const clientWidth = document.documentElement.clientWidth || window.innerWidth
	const fontSize = (clientWidth / baseWidth) * baseSize
	document.documentElement.style.fontSize = `${fontSize}px`
}

// 初始化设置
setRem()
// 监听窗口大小变化
window.addEventListener('resize', setRem)

</script>

<style lang="less">
/* 全局样式重置 */
#app {

	height: 100vh;
	width: 100vw;
	/* min-width: 1080px; */
	background-color: rgb(239, 242, 243);
}
.basicsBox {
	width: 100%;
	background-color: #fff;
	border-radius: 20px;
	padding: 15px 30px 10px 32px;
}

/* 滚动条样式 */
::-webkit-scrollbar {
	width: 6px;
	height: 6px;
}

::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 3px;
}

::-webkit-scrollbar-thumb {
	background: #c1c1c1;
	border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
	background: #a8a8a8;
}

/* Element Plus 样式覆盖 */
.el-menu {
	border-right: none !important;
}


</style>
